import {
  getMessageApi,
  getMessageApi2,
  saveLogApi,
  selectByUuidApi,
  selectListApi,
  getTokenApi,
  getMessageNewApi
} from '@/api/workbench'
const workbench = {
  state: {
    boxHeaderIndex: 0,
    scrollTop: 0
  },
  actions: {
    getMessage({ state }, reponse) {
      // console.log(reponse, 'reponse')
      return new Promise((resolve, reject) => {
        getMessageApi(reponse)
          .then(res => {
            resolve(res)
          })
          .catch(error => {
            reject(error)
          })
      })
    },
    getMessage2({ state }, reponse) {
      // console.log(reponse, 'reponse')
      return new Promise((resolve, reject) => {
        getMessageApi2(reponse)
          .then(res => {
            resolve(res)
          })
          .catch(error => {
            reject(error)
          })
      })
    },
    getMessageNew({ state }, reponse) {
      // console.log(reponse, 'reponse')
      return new Promise((resolve, reject) => {
        getMessageNewApi(reponse)
          .then(res => {
            resolve(res)
          })
          .catch(error => {
            reject(error)
          })
      })
    },
    saveLog({ state }, reponse) {
      return new Promise((resolve, reject) => {
        saveLogApi(reponse)
          .then(res => {
            resolve(res)
          })
          .catch(error => {
            reject(error)
          })
      })
    },
    selectByUuid({ state }, reponse) {
      return new Promise((resolve, reject) => {
        selectByUuidApi(reponse)
          .then(res => {
            resolve(res)
          })
          .catch(error => {
            reject(error)
          })
      })
    },
    selectList({ state }, reponse) {
      return new Promise((resolve, reject) => {
        selectListApi(reponse)
          .then(res => {
            resolve(res)
          })
          .catch(error => {
            reject(error)
          })
      })
    },
    getToken({ state }, reponse) {
      return new Promise((resolve, reject) => {
        getTokenApi(reponse)
          .then(res => {
            resolve(res)
          })
          .catch(error => {
            reject(error)
          })
      })
    }
  },
  mutations: {}
}
export default workbench
